package com.example.recipes;

import com.example.client.ZKConstans;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;

/**
 * @author Creared by wangyang on 2019-01-29 10:21
 * email:techyang.wangy.@ymm56.com
 */
public class CuratorFrameworkHolder {

    public static final CuratorFramework CURATOR_FRAMEWORK = CuratorFrameworkFactory.builder()
            .retryPolicy(new ExponentialBackoffRetry(1000, 3))
            .sessionTimeoutMs(5000)
            .connectionTimeoutMs(3000)
            .connectString(ZKConstans.CONNECTOR_STRING)
            .build();
}
